package com.neusoft.my12306.controller;


import com.neusoft.my12306.common.res.CommonResult;
import com.neusoft.my12306.entity.Schedule;
import com.neusoft.my12306.entity.User;
import com.neusoft.my12306.service.IScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 葛彬
 * @since 2023-07-19
 */
@RestController
@RequestMapping("/schedule")
public class ScheduleController {


    @Autowired
    IScheduleService sheduleService;

    @PostMapping("/query")
    public CommonResult queryTrain(@RequestParam("fromCity") String fromCity,@RequestParam("towardCity") String towardCity) {
        return sheduleService.queryTrain(fromCity,towardCity);
    }

    @PostMapping("/calprice")
    public CommonResult calPrice(@RequestBody Schedule schedule) {
        return sheduleService.calPrice(schedule);
    }

}
